import request from "@/utils/request";

//用户列表
export let userPage = function( params:object ){
    return request({
        url:'/system/user/page',
        params
    })
}

//机构树
export let unitTree = function(){
    return request({
        url:'/system/unit/tree'
    })
}

//全部岗位
export let postAll = function(){
    return request({
        url:'/system/post/all'
    })
}

//全部角色
export let roleAll = function(){
    return request({
        url:'/system/role/all'
    })
}
// 用户详情
export function userGet(id:string) {
    return request({
        url:`/system/user/get/${id}`
    })
}
//添加角色
export let userAdd = function( data ){
    return request({
        url:'/system/user/add',
        method:'post',
        data
    })
}
// 修改用户
export let userUpdate = function( data ){
    return request({
        url:'/system/user/update',
        method:'post',
        data
    })
}
// 删除用户
export let userDelete = function( id:string ){
    return request({
        url:`/system/user/delete/${id}`
    })
}